package com.cbtx.module.common.ui;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.cbtx.module.common.R;
import com.cbtx.module.common.bean.GoodsEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * @author : Lambert
 * date   : 2020/10/24 10:54 AM
 */
public class RenZhengAdapter extends BaseQuickAdapter<GoodsEntity.DataBean.ListBean, BaseViewHolder> {


    public RenZhengAdapter(int layoutResId, @Nullable List<GoodsEntity.DataBean.ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsEntity.DataBean.ListBean item) {
        ImageView mIvCover = helper.getView(R.id.mIvQRCode);
        Glide.with(mContext)
                .load(item.imageSmall)
                .error(R.drawable.ic_default_small)
                .placeholder(R.drawable.ic_default_small)
                .into(mIvCover);

        helper.setText(R.id.mTvType, item.years);
        helper.setText(R.id.mTvTitle, item.goodsName);
    }
}
